package com.woniuxy.ticket_cinema.controller;


import com.woniuxy.ticket_cinema.service.Schedule_seatService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author booty
 * @since 2021-02-22
 */
@Api(tags = "排片-座位管理接口")
@RestController
@RequestMapping("/schedule_seat")
public class Schedule_seatController {

    @Resource
    private Schedule_seatService schedule_seatService;

    @ApiOperation("下订单时，通过排片-座位中间表返回信息，并锁定座位")
    @PostMapping("/findToOrderById")
    public String findToOrderById(@RequestParam("id") @Min(value = 1,message = "排片-座位中间表id至少为1") @NotNull(message = "排片-座位中间表id不能为空") int id){
        return schedule_seatService.findToOrderById(id);
    }

}

